<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vipcard;

class MerchantAccountInfoModel {
	
	static $_TSPEC;
	public $merchantCode = null;
	public $merchantName = null;
	public $accountType = null;
	public $banlance = null;
	public $status = null;
	public $auditMoney = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'merchantCode'
			),
			2 => array(
			'var' => 'merchantName'
			),
			3 => array(
			'var' => 'accountType'
			),
			4 => array(
			'var' => 'banlance'
			),
			5 => array(
			'var' => 'status'
			),
			6 => array(
			'var' => 'auditMoney'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['merchantCode'])){
				
				$this->merchantCode = $vals['merchantCode'];
			}
			
			
			if (isset($vals['merchantName'])){
				
				$this->merchantName = $vals['merchantName'];
			}
			
			
			if (isset($vals['accountType'])){
				
				$this->accountType = $vals['accountType'];
			}
			
			
			if (isset($vals['banlance'])){
				
				$this->banlance = $vals['banlance'];
			}
			
			
			if (isset($vals['status'])){
				
				$this->status = $vals['status'];
			}
			
			
			if (isset($vals['auditMoney'])){
				
				$this->auditMoney = $vals['auditMoney'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'MerchantAccountInfoModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("merchantCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->merchantCode);
				
			}
			
			
			
			
			if ("merchantName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->merchantName);
				
			}
			
			
			
			
			if ("accountType" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->accountType);
				
			}
			
			
			
			
			if ("banlance" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->banlance);
				
			}
			
			
			
			
			if ("status" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->status);
				
			}
			
			
			
			
			if ("auditMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->auditMoney);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->merchantCode !== null) {
			
			$xfer += $output->writeFieldBegin('merchantCode');
			$xfer += $output->writeString($this->merchantCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->merchantName !== null) {
			
			$xfer += $output->writeFieldBegin('merchantName');
			$xfer += $output->writeString($this->merchantName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->accountType !== null) {
			
			$xfer += $output->writeFieldBegin('accountType');
			$xfer += $output->writeString($this->accountType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->banlance !== null) {
			
			$xfer += $output->writeFieldBegin('banlance');
			$xfer += $output->writeString($this->banlance);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->status !== null) {
			
			$xfer += $output->writeFieldBegin('status');
			$xfer += $output->writeString($this->status);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->auditMoney !== null) {
			
			$xfer += $output->writeFieldBegin('auditMoney');
			$xfer += $output->writeString($this->auditMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>